﻿<Window x:Class="P2.Cuberry.Modules.Framework.ModuleManager.ModulesDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
        
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
        
        <!--<DataTemplate x:Key="SubMenuDataTemplate">
            <Canvas Width="236" Height="48">
                <Image Source="{Binding ItemIconName}" Height="32" Width="32" Canvas.Left="8" Canvas.Top="8"/>
                <TextBlock Text="{Binding MenuItemName}" Canvas.Left="56" Canvas.Top="8" Width="172"/>
            </Canvas>
        </DataTemplate>-->
    </Window.Resources>
    
    
    
    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/save.png" />

            
        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderModulesDetails}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn" Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding ModuleSaveCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding ModuleCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                

            </Menu>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Margin="22,14,0,0" Name="ModuleNameL" Height="28" VerticalAlignment="Top" Content="{Translate ModuleNameL}" HorizontalAlignment="Left" Width="120"></Label>
                <TextBox Margin="22,35,0,0" Name="ModuleName" Height="23" Text="{Binding Model.ModuleName, Mode=OneWay}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" IsReadOnly="True" />
                
                <Label Content="{Translate VersionL}" Height="28" HorizontalAlignment="Left" Margin="22,56,0,0" Name="VersionL" VerticalAlignment="Top" Width="120" />
                <TextBox Margin="22,78,0,0" Name="Version"  Height="23" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.Version, Mode=OneWay}" VerticalAlignment="Top"  HorizontalAlignment="Left" Width="247.47" IsReadOnly="True" />

                <Label Content="{Translate LocationL}" Height="28" HorizontalAlignment="Left" Margin="22,99,0,0" Name="LocationL" VerticalAlignment="Top" Width="120" />
                <TextBox Margin="22,120,0,0" Name="Location"  Height="23" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.Location, Mode=OneWay}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247.47" IsReadOnly="True" />
                
                <TabControl Margin="341,3,3,3" Name="tabControl1" MinWidth="540" BorderBrush="{DynamicResource P2BackgroundBrush}" >
                    <TabItem Header="Application Resources" Name="ApplicationResourcesTab" Background="White" >

                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>


                                <Label Grid.Row = "1" Name="ResourceLanguageL" Height="28" VerticalAlignment="Top" Content="{Translate ResourceLanguageL}" 
                                           HorizontalAlignment="Left" Width="120" />
                                <ComboBox Grid.Row="1" Name = "ResourceLanguage" VerticalAlignment="Top" HorizontalAlignment="Left" Width="92" Margin="107,0,0,0" 
                                          Style="{StaticResource P2ComboBoxStyle}" ItemsSource = "{Binding Path=AppLanguages}" 
                                          SelectedValue = "{Binding Path = xAppLanguage}"  
                                          SelectedValuePath = "AppLanguage" DisplayMemberPath = "AppLanguage" SelectedIndex="{Binding AppLanguageIndex}"
                                          SelectionChanged="ResourceLanguage_SelectionChanged"/>

                                <DataGrid Grid.Row="1"  Margin="3,29,3,0" 
                                             Name="ApplicationResourceList" 
                                             ItemsSource="{Binding ApplicationResources}" 
                                              MouseDoubleClick="ApplicationResourceList_MouseDoubleClick"    
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top" >
                                    
                                    <DataGrid.Columns>
                                        <DataGridTextColumn   Header="{Translate ResourceNameL}" IsReadOnly="True"  Binding="{Binding ResourceName}" 
                                                              Width="100" MinWidth="40" />
                                        <DataGridTextColumn   Header="{Translate ResourceLanguageL}" IsReadOnly="True" 
                                                              Binding="{Binding ResourceLanguage}" 
                                                              Width="100" MinWidth="40" />
                                        <DataGridTextColumn   Header="{Translate ResourceTextL}" IsReadOnly="True"  
                                                              Binding="{Binding ResourceText}" 
                                                              Width="*" MinWidth="40" />

                                    </DataGrid.Columns>
                                </DataGrid>
                                
                                <Button Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="AddResourceBtn"  Command="{Binding ModuleManagerAddResourceCommand}"  Height="23" Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/add.png" ></Image>
                                </Button>
                                <Button Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="DeleteResourceBtn"  Command="{Binding ModuleManagerDeleteResourceCommand}" Height="23"  Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Remove.ico"></Image>
                                </Button>
                                
                            </Grid>
                        </Border>
                    </TabItem>
                    <TabItem Header="Entity Workflow" Name="EntityWorkflowTab" Background="White" >                    
                        <Grid  Background="White" >
                            <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                                <Grid ShowGridLines="False">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="55"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="34"/>
                                    </Grid.RowDefinitions>

                                    <Label Content="{Translate WorkflowEntityNameL}" Height="28" HorizontalAlignment="Left" Margin="10,4,0,0" Name="WorkflowEntityNameL" VerticalAlignment="Top" Width="120" />
                                    <ComboBox Grid.RowSpan="2" Height="23.723" HorizontalAlignment="Left" 
                                              IsEnabled="{Binding IsEditable}" Margin="10,24,0,0" 
                                              Name="WorkflowEntityName" 
                                              ItemsSource="{Binding Path=EntWorkFlowEntityNames}" 
                                              Style="{StaticResource P2ComboBoxStyle}"
                                              Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                                              VerticalAlignment="Top" Width="120" 
                                              SelectedIndex="{Binding SelectedWorkFlowEntityName}" 
                                              SelectionChanged="WorkflowEntityName_SelectionChanged"/>

                                    <Label Content="{Translate WorkflowIDL}" Height="28" HorizontalAlignment="Left" Margin="160,4,0,0" Name="WorkflowIDL" VerticalAlignment="Top" Width="120" />
                                    <ComboBox Grid.RowSpan="2" Height="23.723" HorizontalAlignment="Left" IsEnabled="{Binding IsEditable}" 
                                              ItemsSource="{Binding EnterpriseWorkflows}" 
                                              Margin="160,24,0,0" 
                                              Name="WorkflowName" 
                                              Style="{StaticResource P2ComboBoxStyle}" 
                                              Validation.ErrorTemplate="{StaticResource ErrorTemplate}"
                                              SelectedIndex="{Binding SelectedWorkFlow}"
                                              VerticalAlignment="Top" Width="120"
                                              SelectionChanged="WorkflowName_SelectionChanged"/>

                                    <DataGrid Grid.Row="1"  Margin="3,10,3,0" 
                                                 Name="EnterpriseWorkflowStatusList" 
                                                 ItemsSource="{Binding EnterpriseWorkflowStatuses}"
                                                 Style="{DynamicResource CuberryDataGridStyle}"
                                                 VerticalAlignment="Top" >
                                        
                                        <DataGrid.Columns>
                                            <DataGridTextColumn   Header="{Translate StatusIDL}" IsReadOnly="True" Binding="{Binding EnterpriseWorkflowStatusId}"  
                                                              Width="100" MinWidth="40" />
                                            <DataGridTextColumn   Header="{Translate StatusNameL}" IsReadOnly="True" Binding="{Binding WorkflowStatus}" 
                                                              Width="100" MinWidth="40" />
                                            <DataGridTextColumn   Header="{Translate StatusResourceTextL}" IsReadOnly="True"   
                                                              Width="*" MinWidth="40" />

                                        </DataGrid.Columns>
                                    </DataGrid>
                                   
                                </Grid>
                            </Border>

                        </Grid  >                        
                    </TabItem>

                    <TabItem Header="Standard UI Controls" Name="UIControlsTab" Background="White" >
                        <Grid  Background="White">

                            <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                                <Grid ShowGridLines="False">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="55"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="34"/>
                                    </Grid.RowDefinitions>

                                    <Label Content="{Translate DialogNameL}" Height="28" HorizontalAlignment="Left" Margin="10,4,0,0" Name="StandardDialogNameL" VerticalAlignment="Top" Width="120" />
                                    <ComboBox Grid.RowSpan="2" Height="23.723" HorizontalAlignment="Left" 
                                              IsEnabled="{Binding IsEditable}" 
                                              ItemsSource="{Binding Path = DialogNames}" Margin="10,24,0,0" Name="DialogName" 
                                              SelectedValue="{Binding Path = xDialogNames}" 
                                              SelectedValuePath="DialogName"
                                              DisplayMemberPath="DialogName" 
                                              Style="{StaticResource P2ComboBoxStyle}" 
                                              Validation.ErrorTemplate="{StaticResource ErrorTemplate}" 
                                              VerticalAlignment="Top" Width="240"
                                              SelectedIndex="{Binding DialogNameIndex}"
                                              SelectionChanged="DialogName_SelectionChanged" />
                                   
                                    <DataGrid Grid.Row="1"  Margin="3,10,3,0" 
                                                 Name="ConfigUIControlsList" 
                                                 ItemsSource="{Binding ConfigUIControls}"
                                                 Style="{DynamicResource CuberryDataGridStyle}"
                                                 VerticalAlignment="Top" MouseDoubleClick="ConfigUIControlsList_MouseDoubleClick" >
                                        
                                        <DataGrid.Columns>
                                            <DataGridTextColumn Header="{Translate DialogNameL}" IsReadOnly="True"  Binding="{Binding DialogName}"
                                                                Width="*" MinWidth="40" />
                                            <DataGridTextColumn Header="{Translate ControlNameL}" IsReadOnly="True" Binding="{Binding ControlName}"
                                                              Width="*" MinWidth="40" />
                                            <DataGridTextColumn   Header="{Translate ControlTypeL}" IsReadOnly="True" Binding="{ Binding ControlType}"
                                                              Width="100" MinWidth="40" />
                                            <DataGridCheckBoxColumn   Header="{Translate IsActiveL}" IsReadOnly="True" Binding="{Binding IsActive}"
                                                              Width="100" MinWidth="40" />


                                        </DataGrid.Columns>
                                    </DataGrid>
                                    <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="AddStandardControlBtn"  Command="{Binding ModuleManagerAddConfigUIControlsCommand}"  Height="23" Width="23">
                                        <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/add.png"></Image>
                                    </Button>
                                    <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="DeleteStandardControlBtn"  Command="{Binding ModuleManagerDeleteConfigUIControlsCommand}" Height="23"  Width="23">
                                        <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Remove.ico"></Image>
                                    </Button>
                                </Grid>
                            </Border>


                        </Grid  >
                    </TabItem>

                    <TabItem Header="Workflow UI Controls" Name="WorkflowUIControlsTab" Background="White" >
                        <Grid  Background="White">

                            <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                                <Grid ShowGridLines="False">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="55"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="34"/>
                                    </Grid.RowDefinitions>

                                    <Label Content="{Translate DialogNameL}" Height="28" HorizontalAlignment="Left" Margin="10,4,0,0" Name="WorkflowDialogNameL" VerticalAlignment="Top" Width="120" />
                                    <ComboBox Grid.RowSpan="2" Height="23.723" HorizontalAlignment="Left" 
                                              IsEnabled="{Binding IsEditable}" 
                                              ItemsSource="{Binding WorkflowDialogNames}" Margin="10,24,0,0" Name="WorkflowDialogName" 
                                              SelectedValue="{Binding Path = xDialogNames}" 
                                              SelectedValuePath="DialogName"
                                              DisplayMemberPath="DialogName"                                               
                                              Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}"
                                              SelectedIndex="{Binding DialogNameIndex}"
                                              VerticalAlignment="Top" Width="240" SelectionChanged="WorkflowDialogName_SelectionChanged" />

                                    <DataGrid Grid.Row="1"  Margin="3,10,3,0" 
                                                 Name="WorkflowUIControlsList" 
                                                 ItemsSource="{Binding ConfigWorkFlowUIControls}"                                                 
                                                 Style="{DynamicResource CuberryDataGridStyle}"
                                                 VerticalAlignment="Top"
                                                  MouseDoubleClick="WorkflowUIControlsList_MouseDoubleClick" >
                                        
                                        <DataGrid.Columns>
                                            <DataGridTextColumn Header="{Translate StatusL}" IsReadOnly="True" Binding="{Binding StatusName}"
                                                              Width="100" MinWidth="40" />
                                            <DataGridTextColumn Header="{Translate DialogNameL}" IsReadOnly="True" Binding="{Binding DialogName}"
                                                              Width="100" MinWidth="40" />                                            
                                            <DataGridTextColumn Header="{Translate ControlNameL}" IsReadOnly="True" Binding="{Binding ControlName}" 
                                                              Width="*" MinWidth="40" />
                                            <DataGridTextColumn   Header="{Translate ControlTypeL}" IsReadOnly="True" Binding="{Binding ControlType}"
                                                              Width="100" MinWidth="40" />
                                            <DataGridCheckBoxColumn   Header="{Translate IsActiveL}" IsReadOnly="True" Binding="{Binding IsActive}"
                                                              Width="100" MinWidth="40" />


                                        </DataGrid.Columns>
                                    </DataGrid>
                                    <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="AddWorkflowControlBtn"  
                                            Command="{Binding ModuleManagerAddConfigWorkFlowUIControlsCommand}"  Height="23" Width="23">
                                        <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/add.png"></Image>
                                    </Button>
                                    <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="DeleteWorkflowControlBtn"  
                                            Command="{Binding ModuleManagerDeleteConfigWorkFlowUIControlsCommand}" Height="23"  Width="23">
                                        <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Remove.ico"></Image>
                                    </Button>
                                </Grid>
                            </Border>


                        </Grid  >
                    </TabItem>
                    
                    <TabItem Header="Mandatory Fields" Name="MandatoryFieldsTab" Background="White" >
                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>

                                <DataGrid Grid.Row="1"  Margin="3,0,3,0" 
                                             Name="ConfigValidationMandatoryFieldsList" 
                                             ItemsSource="{Binding ConfigValidationMandatoryFields}"
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top" 
                                             MouseDoubleClick="ConfigValidationMandatoryFieldsList_MouseDoubleClick" >
                                    
                                    <DataGrid.Columns>
                                        <DataGridTextColumn   Header="{Translate EntityNameL}" IsReadOnly="True" Width="100" MinWidth="40" 
                                                              Binding = "{Binding FieldEntityName}" />
                                        <DataGridTextColumn   Header="{Translate FieldNameL}" IsReadOnly="True" Width="100" MinWidth="40"
                                                              Binding= "{Binding FieldName}" />
                                        <DataGridTextColumn   Header="{Translate ValidationTypeL}" IsReadOnly="True" Width="*" MinWidth="40"
                                                              Binding= "{Binding ValidationType}" />
                                        <DataGridCheckBoxColumn Header="{Translate IsMandatoryL}" IsReadOnly="True" Width="70" MinWidth="40"
                                                                  Binding= "{Binding IsMandatory}" />
                                        <DataGridCheckBoxColumn Header="{Translate IsUniqueL}" IsReadOnly="True" Width="70" MinWidth="40" 
                                                                  Binding= "{Binding IsUnique}" />
                                        <DataGridCheckBoxColumn Header="{Translate IsUniqueInCombiniationL}" IsReadOnly="True" Width="70" MinWidth="40" 
                                                                  Binding = "{Binding IsUniqueInCombination}" />

                                    </DataGrid.Columns>
                                </DataGrid>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="AddMandatoryFieldBtn"  Command="{Binding ModuleManagerAddConfigValidationMandatoryFields}"  Height="23" Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/add.png"></Image>
                                </Button>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="DeleteMandatoryFieldBtn"  Command="{Binding ModuleManagerDeleteConfigValidationMandatoryFields}" Height="23"  Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Remove.ico"></Image>
                                </Button>
                            </Grid>
                        </Border>
                    </TabItem>


                    <TabItem Header="Field Validation" Name="FieldValidationsTab" Background="White" >
                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>

                                <DataGrid Grid.Row="1"  Margin="3,0,3,0" 
                                             Name="FieldValidationsList" 
                                             ItemsSource="{Binding FieldValidations}"
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top" MouseDoubleClick="FieldValidationsList_MouseDoubleClick" >
                                    
                                    <DataGrid.Columns>
                                        <DataGridTextColumn   Header="{Translate EntityNameL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="80" Binding="{Binding FieldEnitytName}" />
                                        <DataGridTextColumn   Header="{Translate FieldNameL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="80" Binding="{Binding FieldName}" />
                                        <DataGridTextColumn   Header="{Translate ControlTypeL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="80" Binding="{Binding ControlType}" />                                                                                
                                        <DataGridTextColumn   Header="{Translate ControlContentTypeL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="80" Binding="{Binding ControlContentType}" />
                                        <DataGridTextColumn   Header="{Translate RegExL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding RegEx}" />
                                        <DataGridTextColumn   Header="{Translate MinDateTimeL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding MinDateTime}"/>
                                        <DataGridTextColumn   Header="{Translate MaxDateTimeL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding MaxDateTime}"/>
                                        <DataGridTextColumn   Header="{Translate MinIntL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding MinInt}"/>
                                        <DataGridTextColumn   Header="{Translate MaxIntL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding MaxInt}"/>
                                        <DataGridTextColumn   Header="{Translate MinTextL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding MinText}"/>
                                        <DataGridTextColumn   Header="{Translate MaxTextL}" IsReadOnly="True"  
                                                              Width="100" MinWidth="40" Binding="{Binding MaxText}"/>
                                        <DataGridTextColumn   Header="{Translate ValidationTypeL}" IsReadOnly="True" 
                                                              Width="*" MinWidth="40" Binding="{Binding ValidationType}"/>
                                    </DataGrid.Columns>
                                </DataGrid>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="AddFieldValidationBtn"  
                                        Command="{Binding ModuleManagerAddFieldValidationCommand}"  Height="23" Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/add.png"></Image>
                                </Button>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="DeleteFieldValidationBtn"  
                                        Command="{Binding ModuleManagerDeleteFieldValidationCommand}" Height="23"  Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Remove.ico"></Image>
                                </Button>
                            </Grid>
                        </Border>
                    </TabItem>

                    <TabItem Header="Field Tracking" Name="FieldsTrackingTab" Background="White" >
                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>

                                <DataGrid Grid.Row="1"  Margin="3,0,3,0" 
                                             Name="FieldTrackingList"                                          
                                             ItemsSource="{Binding FieldTrackings}"
                                             Style="{DynamicResource CuberryDataGridStyle}"
                                             VerticalAlignment="Top"
                                             MouseDoubleClick = "FieldTrackingList_MouseDoubleClick" >
                                    
                                    <DataGrid.Columns>
                                        <DataGridTextColumn   Header="{Translate EntityNameL}" IsReadOnly="True" Binding = "{Binding FieldEntityName}"   
                                                              Width="150" MinWidth="40" />
                                        <DataGridTextColumn   Header="{Translate FieldNameL}" IsReadOnly="True" Binding = "{Binding FieldName}"  
                                                              Width="*" MinWidth="40" />                                       

                                    </DataGrid.Columns>
                                </DataGrid>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="AddTrackedFieldBtn"  Command="{Binding ModuleManagerAddFieldTrackingCommand}"  Height="23" Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/add.png"></Image>
                                </Button>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="DeleteTrackedFieldBtn"  Command="{Binding ModuleManagerDeleteFieldTrackingCommand}" Height="23"  Width="23">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Remove.ico"></Image>
                                </Button>
                            </Grid>
                        </Border>
                        </TabItem>

                       <TabItem Header="Menu Position" Name="MenuPositionTab" Background="White" >                        
                        <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                            <Grid ShowGridLines="False">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="20"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="34"/>
                                </Grid.RowDefinitions>
                                
                                <ListBox Grid.Row="1" Margin="10,5,10,5" Name="MenuMainMenuItemsList" HorizontalAlignment="Left" Width="200" 
                                         ItemsSource="{Binding Path=MainMenuItems}" 
                                         DisplayMemberPath="MenuItemName"
                                         SelectedValuePath="MenuItemName"
                                         SelectedValue="MenuItemId" FontSize="15"
                                         SelectionChanged="MenuMainMenuItemsList_SelectionChanged"
                                         AllowDrop="True"
                                         Drop="MenuMainMenuItemsList_Drop"/>

                                <ListBox Grid.Row="1" Margin="10,5,10,5" Name="MenuSubMenuItemsList" HorizontalAlignment="Right" Width="200" FontSize="15"
                                         ItemsSource="{Binding Path=SubMenuItems}"
                                         DisplayMemberPath="MenuItemName"
                                         SelectedValuePath="MenuItemName"
                                         SelectedValue="SubMenuItemId"
                                         PreviewMouseLeftButtonDown="MenuSubMenuItemsList_PreviewMouseLeftButtonDown">
                                    
                                    <!--<ListBox.ItemTemplate>
                                        <DataTemplate>
                                            <StackPanel Orientation="Horizontal">
                                                <Image Source="{Binding Path=ItemIconName}" />
                                                <TextBlock Text="{Binding Path=MenuItemName}" Background="Brown" />
                                            </StackPanel>
                                        </DataTemplate>
                                    </ListBox.ItemTemplate>-->
                                
                                </ListBox>

                                <Button Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="MoveUpInMainMenuBtn" 
                                        Command="{Binding MoveUpInMainMenCommand}"  Height="23" Width="23" CommandParameter="{Binding SelectedItem, ElementName=MenuMainMenuItemsList}">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/MoveUp.ico"></Image>
                                </Button>
                                <Button Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="28,3,3,3" Name="MoveDownInMainMenuBtn"  
                                        Command="{Binding MoveDownInMainMenuCommand}" Height="23"  Width="23" CommandParameter="{Binding SelectedItem, ElementName=MenuMainMenuItemsList}">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/MoveDown.ico"></Image>
                                </Button>

                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Margin="3,3,28,3" Name="MoveUpInSubMenuBtn" 
                                        Command="{Binding MoveUpInSubMenuCommand}"  Height="23" Width="23" CommandParameter="{Binding SelectedItem, ElementName=MenuSubMenuItemsList}">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/MoveUp.ico"></Image>
                                </Button>
                                <Button Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="3,3,3,3" Name="MoveDownInSubMenuBtn"  
                                        Command="{Binding MoveDownInSubMenuCommand}" Height="23"  Width="23" CommandParameter="{Binding SelectedItem, ElementName=MenuSubMenuItemsList}">
                                    <Image  Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/MoveDown.ico"></Image>
                                </Button>
                            </Grid>
                        </Border>
                    </TabItem>

                </TabControl>
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
